// eslint-disable-next-line
import {UserLayout, BasicLayout, BlankLayout} from '@/layouts'
import { bxAnaalyse } from '@/core/icons'

// const RouteView = {
//   name: 'RouteView',
//   render: h => h('router-view')
// }

export const asyncRouterMap = [
  {
    path: '/',
    name: 'index',
    component: BasicLayout,
    meta: { title: '后台管理', icon: bxAnaalyse },
    redirect: '/index',
    children: [
      {
        path: '/index',
        name: 'index',
        component: () => import('@/views/index/Index'),
        meta: { title: '首页' },
      },
      {
        path: '/permission',
        name: 'permission',
        component: BlankLayout,
        meta: { title: '用户管理' },
        children: [
          {
            path: '/permission/users',
            name: 'users',
            component: () => import('@/views/user'),
            meta: { title: '用户列表', keepAlive: false }
          },
          {
            path: '/permission/depart',
            name: 'depart',
            component: () => import('@/views/depart'),
            meta: { title: '部门管理', keepAlive: false }
          },
          {
            path: '/permission/modal',
            name: 'modal',
            component: () => import('@/views/modal'),
            meta: { title: '权限管理', keepAlive: false }
          },
          {
            path: '/permission/roles',
            name: 'roles',
            component: () => import('@/views/role'),
            meta: { title: '角色管理', keepAlive: false }
          },
          {
            path: '/permission/menu',
            name: 'menu',
            component: () => import('@/views/menu'),
            meta: { title: '菜单管理', keepAlive: false }
          }
        ]
      },
      {
        path: '/system',
        name: 'system',
        component: BlankLayout,
        meta: { title: '系统配置' },
        children: [
          // get_ThirdCompany
          {
            path: '/system/company',
            name: 'company',
            component: () => import('@/views/company'),
            meta: { title: '第三方公司', keepAlive: false }
          },
          {
            path: '/system/data',
            name: 'data',
            component: () => import('@/views/data'),
            meta: { title: '数据管理', keepAlive: false }
          },
          {
            path: '/system/msg-if',
            name: 'msgIf',
            component: () => import('@/views/msg-if'),
            meta: { title: '短信接口管理', keepAlive: false }
          },
          {
            path: '/system/water',
            name: 'water',
            component: () => import('@/views/water'),
            meta: { title: '水印管理', keepAlive: false }
          },
          {
            path: '/system/hot-data',
            name: 'hotData',
            component: () => import('@/views/hot-data'),
            meta: { title: '前端页面自动刷新时间', keepAlive: false }
          },
          {
            path: '/system/login-log',
            name: 'loginLog',
            component: () => import('@/views/login-log'),
            meta: { title: '登录日志', keepAlive: false }
          },
          {
            path: '/system/handle-log',
            name: 'handleLog',
            component: () => import('@/views/handle-log'),
            meta: { title: '操作日志', keepAlive: false }
          },
          {
            path: '/system/403',
            name: '403',
            component: () => import('@/views/403/index'),
            meta: { title: '403网站链接', keepAlive: false }
          }

        ]
      },
      {
        path: '/instructions',
        name: 'instructions',
        component: BlankLayout,
        meta: { title: '信息同步' },
        children: [
          {
            path: '/instructions/index',
            name: 'instructions',
            component: () => import('@/views/instructions/Index2.vue'),
            meta: { title: '情况反馈', keepAlive: false }
          },
          {
            path: '/instructions/send',
            name: 'instructions-send',
            component: () => import('@/views/instructions/Send.vue'),
            meta: { title: '下发指令', keepAlive: false }
          },
        ]
      },
      {
        path: '/risk',
        name: 'risk',
        component: BlankLayout,
        meta: { title: '上报⻛险' },
        children: [
          {
            path: '/risk/event',
            name: 'risk-event',
            component: () => import('@/views/instructions/Event.vue'),
            meta: { title: '舆情⻛险上报', keepAlive: false }
          },
        ]
      },
      // 属地数据库
      {
        path: '/db',
        component: BlankLayout,
        redirect: { path: '/db/account' },
        meta: {
          title: '属地数据库'
        },
        children: [
          {
            path: '/db/account',
            meta: {
              title: '网络账号数据库'
            },
            name: 'account',
            component: () => import('@/views/db/Account/Index.vue')
          },
          {
            path: '/db/account/edit',
            meta: {
              title: '网络账号数据库',
              name: '网络账号'
            },
            hidden: true,
            name: 'account-edit',
            component: () => import('@/views/db/Account/action/createInfo.vue')
          },
          {
            path: '/db/SpecialRectificatio',
            meta: {
              title: '专项整治数据库'
            },
            name: 'SpecialRectificatio',
            component: () => import('@/views/db/SpecialRectificatio/Index.vue')
          },
          {
            path: '/db/specialRectificatio/edit',
            meta: {
              title: '专项整治数据库',
              name: '专项整治数据'
            },
            hidden: true,
            name: 'SpecialRectificatio-edit',
            component: () => import('@/views/db/SpecialRectificatio/action/createInfo.vue')
          },
          {
            path: '/db/Enforcement',
            meta: {
              title: '网络安全专家库'
            },
            name: 'Enforcement',
            component: () => import('@/views/db/Enforcement/Index.vue')
          },
          {
            path: '/db/enforcement/edit',
            meta: {
              title: '网络安全专家库',
              name: '网络安全专家库'
            },
            hidden: true,
            name: 'Enforcement-edit',
            component: () => import('@/views/db/Enforcement/action/createInfo.vue')
          },
          {
            path: '/db/specialRectificatio/edit',
            meta: {
              title: '专项整治数据库',
              name: '专项整治数据'
            },
            hidden: true,
            name: 'SpecialRectificatio-edit',
            component: () => import('@/views/db/SpecialRectificatio/action/createInfo.vue')
          },
          {
            path: '/db/EnforcementCases',
            meta: {
              title: '执法案例数据库'
            },
            name: 'EnforcementCases',
            component: () => import('@/views/db/EnforcementCases/Index.vue')
          },
          {
            path: '/db/enforcementCases/edit',
            meta: {
              title: '执法案例数据库',
              name: '执法案例数据'
            },
            hidden: true,
            name: 'EnforcementCases-edit',
            component: () => import('@/views/db/EnforcementCases/action/createInfo.vue')
          },
          {
            path: '/db/Popularizing',
            meta: {
              title: '普法基地数据库'
            },
            name: 'Popularizing',

            component: () => import('@/views/db/Popularizing/Index.vue')
          },
          {
            path: '/db/popularizing/edit',
            meta: {
              title: '普法基地数据库',
              name: '普法基地数据'
            },
            hidden: true,
            name: 'Popularizing-edit',
            component: () => import('@/views/db/Popularizing/action/createInfo.vue')
          },
          {
            path: '/db/StressEnterprises',
            meta: {
              title: '重点企业数据库'
            },
            name: 'StressEnterprises',

            component: () => import('@/views/db/StressEnterprises/Index.vue')
          },
          {
            path: '/db/stressEnterprises/edit',
            meta: {
              title: '重点企业数据库',
              name: '重点企业数据'
            },
            hidden: true,
            name: 'StressEnterprises-edit',
            component: () => import('@/views/db/StressEnterprises/action/createInfo.vue')
          },
        ]
      },

    ]
  },
  {
    path: '*',
    redirect: '/404',
    hidden: true
  }
]

/**
 * 基础路由
 * @type { *[] }
 */
export const constantRouterMap = [
  {
    path: '/auth',
    component: UserLayout,
    // redirect: '/auth/login',
    hidden: true,
    children: [
      {
        path: 'login',
        name: 'login',
        component: () => import(/* webpackChunkName: "user" */ '@/views/login/index')
      },
      {
        path: 'loginz',
        name: 'loginz',
        component: () => import(/* webpackChunkName: "user" */ '@/views/login/index2.vue')
      }
    ]
  },
  {
    path: '/404',
    component: () => import(/* webpackChunkName: "fail" */ '@/views/exception/404')
  }
]
